import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'homeController.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class HomePage extends GetView<HomeController> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('home-title'.tr)),
      body: SafeArea(
        child: ListView.separated(
          shrinkWrap: true,
          physics: BouncingScrollPhysics(),
          itemBuilder: (context, index) {
            return buildItems();
          },
          separatorBuilder: (context, index) {
            return Divider(
              indent: 160.w,
              height: 1.0,
              color: Colors.grey[300],
            );
          },
          itemCount: 20,
        ),
      ),
    );
  }

  Widget buildItems() {
    return Container(
      child: Row(
        children: [
          Container(
            child: Container(
              margin: EdgeInsets.all(20.w),
              padding: EdgeInsets.all(50.r),
              color: Colors.grey,
            ),
          ),
          Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Row(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Container(
                    alignment: Alignment.centerLeft,
                    color: Colors.grey,
                    child: Text(
                      "思博乐 ZZSS~026班",
                      style: TextStyle(
                        fontSize: 30.sp,
                      ),
                    ),
                  ),
                  Container(
                    color: Colors.orange,
                    alignment: Alignment.topRight,
                    child: Text(
                      "11:00",
                      style: TextStyle(
                        color: Colors.grey[400],
                        fontSize: 26.sp,
                      ),
                    ),
                  )
                ],
              ),
              Container(
                //color: Colors.blue,
                child: Text(
                  "Jesssie 妈妈:[分享] 思博乐英语的jessie分享录...",
                  style: TextStyle(
                    color: Colors.grey[400],
                    fontSize: 26.sp,
                  ),
                  maxLines: 2,
                ),
              )
            ],
          )
        ],
      ),
    );
  }
}
